package com.example.annotation;

import com.rabbitmq.client.BuiltinExchangeType;
import org.springframework.stereotype.Service;

import java.lang.annotation.*;

@Service
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface RabbitmqListener {

    //exchange名称
    String exchange() default "";

    //queues名称
    String queues() default "";

    //是否持久
    boolean durable() default false;

    //是否独占消费
    boolean exclusive() default false;

    //是否自动删除
    boolean autoDelete() default true;

    //队列类型
    BuiltinExchangeType type() default BuiltinExchangeType.FANOUT;

    //路由key
    String routingKey() default "";

    //额外属性
    RabbitmqProp[] props() default {};
}
